package com.dianneng.show.adapter;

import android.content.Context;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dianneng.show.R;
import com.dianneng.show.model.BaseResult;
import com.dianneng.show.model.DayInfo;
import com.dianneng.show.model.SNInfo;

import java.util.List;

/**
 * Created by Administrator on 2018\10\20 0020.
 */

public class SNInfoAdapter extends BaseQuickAdapter<DayInfo.DataBean,SNInfoAdapter.MyViewHolder> {


    private Context mContext;

    public SNInfoAdapter(List<DayInfo.DataBean> data,Context context) {
        super(R.layout.item_sn_list,data);
        mContext=context;
    }

    @Override
    protected void convert(MyViewHolder helper, DayInfo.DataBean item) {
        if (item.isTitle()){
            helper.setTextColor(R.id.tv_sn,mContext.getResources().getColor(R.color.white));
            helper.setTextColor(R.id.tv_dianneng,mContext.getResources().getColor(R.color.white));
            helper.setTextColor(R.id.tv_dianya,mContext.getResources().getColor(R.color.white));
            helper.setTextColor(R.id.tv_dianliu,mContext.getResources().getColor(R.color.white));
            helper.setTextColor(R.id.tv_shunshiyou,mContext.getResources().getColor(R.color.white));
            helper.setTextColor(R.id.tv_shunshiyouABC,mContext.getResources().getColor(R.color.white));
            helper.setTextColor(R.id.tv_shunshiwu,mContext.getResources().getColor(R.color.white));
            helper.setTextColor(R.id.tv_shunshiwuABC,mContext.getResources().getColor(R.color.white));
            helper.setTextColor(R.id.tv_zongyinshu,mContext.getResources().getColor(R.color.white));
            helper.setTextColor(R.id.tv_zongyinshuABC,mContext.getResources().getColor(R.color.white));
            helper.setTextColor(R.id.tv_dianwang,mContext.getResources().getColor(R.color.white));
            helper.setTextColor(R.id.tv_time,mContext.getResources().getColor(R.color.white));

            helper.setBackgroundColor(R.id.tv_sn,mContext.getResources().getColor(R.color.colorAccent));
            helper.setBackgroundColor(R.id.tv_dianneng,mContext.getResources().getColor(R.color.colorAccent));
            helper.setBackgroundColor(R.id.tv_dianya,mContext.getResources().getColor(R.color.colorAccent));
            helper.setBackgroundColor(R.id.tv_dianliu,mContext.getResources().getColor(R.color.colorAccent));
            helper.setBackgroundColor(R.id.tv_shunshiyou,mContext.getResources().getColor(R.color.colorAccent));
            helper.setBackgroundColor(R.id.tv_shunshiyouABC,mContext.getResources().getColor(R.color.colorAccent));
            helper.setBackgroundColor(R.id.tv_shunshiwu,mContext.getResources().getColor(R.color.colorAccent));
            helper.setBackgroundColor(R.id.tv_shunshiwuABC,mContext.getResources().getColor(R.color.colorAccent));
            helper.setBackgroundColor(R.id.tv_zongyinshu,mContext.getResources().getColor(R.color.colorAccent));
            helper.setBackgroundColor(R.id.tv_zongyinshuABC,mContext.getResources().getColor(R.color.colorAccent));
            helper.setBackgroundColor(R.id.tv_dianwang,mContext.getResources().getColor(R.color.colorAccent));
            helper.setBackgroundColor(R.id.tv_time,mContext.getResources().getColor(R.color.colorAccent));


        }else {
            helper.setTextColor(R.id.tv_sn,mContext.getResources().getColor(R.color.white));
            helper.setTextColor(R.id.tv_dianneng,mContext.getResources().getColor(R.color.gray_3));
            helper.setTextColor(R.id.tv_dianya,mContext.getResources().getColor(R.color.gray_3));
            helper.setTextColor(R.id.tv_dianliu,mContext.getResources().getColor(R.color.gray_3));
            helper.setTextColor(R.id.tv_shunshiyou,mContext.getResources().getColor(R.color.gray_3));
            helper.setTextColor(R.id.tv_shunshiyouABC,mContext.getResources().getColor(R.color.gray_3));
            helper.setTextColor(R.id.tv_shunshiwu,mContext.getResources().getColor(R.color.gray_3));
            helper.setTextColor(R.id.tv_shunshiwuABC,mContext.getResources().getColor(R.color.gray_3));
            helper.setTextColor(R.id.tv_zongyinshu,mContext.getResources().getColor(R.color.gray_3));
            helper.setTextColor(R.id.tv_zongyinshuABC,mContext.getResources().getColor(R.color.gray_3));
            helper.setTextColor(R.id.tv_dianwang,mContext.getResources().getColor(R.color.gray_3));
            helper.setTextColor(R.id.tv_time,mContext.getResources().getColor(R.color.gray_3));

            helper.setBackgroundColor(R.id.tv_sn,mContext.getResources().getColor(R.color.gray_3));
            helper.setBackgroundColor(R.id.tv_dianneng,mContext.getResources().getColor(R.color.gray_1));
            helper.setBackgroundColor(R.id.tv_dianya,mContext.getResources().getColor(R.color.gray_1));
            helper.setBackgroundColor(R.id.tv_dianliu,mContext.getResources().getColor(R.color.gray_1));
            helper.setBackgroundColor(R.id.tv_shunshiyou,mContext.getResources().getColor(R.color.gray_1));
            helper.setBackgroundColor(R.id.tv_shunshiyouABC,mContext.getResources().getColor(R.color.gray_1));
            helper.setBackgroundColor(R.id.tv_shunshiwu,mContext.getResources().getColor(R.color.gray_1));
            helper.setBackgroundColor(R.id.tv_shunshiwuABC,mContext.getResources().getColor(R.color.gray_1));
            helper.setBackgroundColor(R.id.tv_zongyinshu,mContext.getResources().getColor(R.color.gray_1));
            helper.setBackgroundColor(R.id.tv_zongyinshuABC,mContext.getResources().getColor(R.color.gray_1));
            helper.setBackgroundColor(R.id.tv_dianwang,mContext.getResources().getColor(R.color.gray_1));
            helper.setBackgroundColor(R.id.tv_time,mContext.getResources().getColor(R.color.gray_1));
        }


        helper.setText(R.id.tv_sn,item.getSn());
        helper.setText(R.id.tv_dianneng,item.getDiannengS());
        helper.setText(R.id.tv_dianya,item.getDianyaABC());
        helper.setText(R.id.tv_dianliu,item.getDianliuABC());
        helper.setText(R.id.tv_shunshiyou,item.getShunshiyouS());
        helper.setText(R.id.tv_shunshiyouABC,item.getShunshiyouABC());
        helper.setText(R.id.tv_shunshiwu,item.getShunshiwuS());
        helper.setText(R.id.tv_shunshiwuABC,item.getShunshiwuABC());
        helper.setText(R.id.tv_zongyinshu,item.getZongyinshuS());
        helper.setText(R.id.tv_zongyinshuABC,item.getZongyinshuABC());
        helper.setText(R.id.tv_dianwang,item.getDianwangS());
        helper.setText(R.id.tv_time,item.getTime());
    }


    static class MyViewHolder extends BaseViewHolder {

        public MyViewHolder(View view) {
            super(view);
        }
    }
}
